View Device Properties
View device objects have six accessible properties, as shown in Figure 7-12. Note that, because a view device is an object and not a data structure, the order of the properties as shown in Figure 7-12 is completely arbitrary. Properties in italics are references to other objects.Figure 7-12 View device object properties
These are the accessible properties:
Note that QuickDraw GX sets the properties for all onscreen view devices (view device objects that represent physical display devices present on the user's system). You cannot change the properties of those view devices.
- Clip. A specialized shape geometry that defines the active imaging area of the view device. Only the parts of the view device's bitmap that overlap with the clip can be drawn to. The view device clip is further described in the next section, "View Device Clip and Mapping."
- Mapping. A mathematical matrix that specifies the translation, scaling, rotation, skewing, and perspective of shapes drawn on this view device. The view device mapping is further described in the next section, "View Device Clip and Mapping."
- Bitmap. A bitmap structure that represents the imaging area of the view device. The view device bitmap is further described in the section "View Device Bitmap" on page 7-26.
- View group. A reference to the view group object to which this view device belongs. View groups are described in the section "About View Group Objects" beginning on page 7-29.
- Attributes. A set of flags that affect the state of activity and memory use of this view device. See the section "View Device Attributes" on page 7-27 for more information.
- Tag list. A list of references to custom information about this view device object, stored in private structures called tag objects. The chapter "Tag Objects" in this book describes tag objects in general and how you can use them to add custom information to objects.
View Device Clip and Mapping
Like transforms and view ports, view device objects have a clip property and a mapping property. A view device's mapping and clip are applied to a shape after those of the transform and the view port have already been applied.The clip and mapping properties for a view device follow the same general conventions as for transform objects. The clip property specifies a mask that restricts the area on the device in which drawing or printing takes place. The clip is equivalent to a primitive shape, a shape whose geometry and fill properties by themselves define the shape. Specifically, a clip can be a framed or filled geometric shape, a glyph shape, a 1-bit-per-pixel bitmap shape, or an empty or full shape. Primitive shapes are described in more detail in the geometric operations chapter of Inside Macintosh: QuickDraw GX Graphics.
The filled or framed parts of the clip define the areas in which drawing can occur. In most cases the view device clip is simply a filled rectangle, often covering exactly the imageable area of the device. You can, however, restrict drawing to a single portion of the device by making the clip shape smaller.
The mapping property of a view device is a 3 3 matrix that specifies one or more transformations that the view device applies to shapes drawn into it. You can use the view device mapping like other mappings, to perform translation, scaling, rotation, skewing, or perspective. However, in most cases the view device mapping is used only to position the view device relative to other view devices and view ports, and to define its pixel size (an identity mapping usually means that pixel size is 72 per inch). You normally do not need to modify a view device's mapping, although it is possible for view device objects that you create yourself.
View Device Bitmap
The bitmap property of a view device is stored as a bitmap structure (typegxBitmap
) that represents the imaging area of the device. The bitmap specifies the height, width, and pixel depth of the view device. The upper left corner of the pixel image is the upper left corner of the imaging area of the device; if the view device object has an identity mapping, that also corresponds to location (0.0, 0.0) in the view group to which the view device belongs.The bitmap also specifies, possibly by using a reference to a color set object, the color of each pixel and the set of available colors on the device. (Bitmaps with fewer than 16 bits per pixel must use a color set.) The bitmap may also include a reference to a color profile object that defines the color response characteristics of the device.
The end result of a drawing operation is the assignment of pixel values to the bitmap of a view device, followed by the transfer of those pixels to the screen or onto paper. In screen drawing or in printing, you can use transfer modes that either ignore or take into account the current pixel values of the bitmap, which themselves may be the products of previous drawing actions.
When you retrieve the bitmap property of a view device object, QuickDraw GX returns it to you as a bitmap shape that includes the information from the bitmap structure in the view device.
Bitmap shapes are described in the bitmap shapes chapter of Inside Macintosh: QuickDraw GX Graphics. Color set objects and color profile objects are described in
the chapter "Color and Color-Related Objects" in this book.View Device Attributes
Each view device object has a set of attributes, a group of flags that influence device behavior. View device attributes allow you to make a device active or inactive, and to specify whether or not the pixel image needs to be stored in directly accessible memory. Table 7-3 lists the constants for the view device attributes and describes what each one means. The constants are defined in thegxDeviceAttributes
enumeration.